// DataSelectDialog.cpp : implementation file
//

#include "stdafx.h"
#include "ExperimentScheduler.h"
#include "DataSelectDialog.h"


// CDataSelectDialog dialog

IMPLEMENT_DYNAMIC(CDataSelectDialog, CDialog)

CDataSelectDialog::CDataSelectDialog(vector<int> & cData,CWnd* pParent /*=NULL*/)
	: CDialog(CDataSelectDialog::IDD, pParent)
	, m_rgData(cData)
{

}

CDataSelectDialog::~CDataSelectDialog()
{
}

void CDataSelectDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_COMBO1, m_cComboBox);
}


BEGIN_MESSAGE_MAP(CDataSelectDialog, CDialog)
	ON_CBN_SELCHANGE(IDC_COMBO1, &CDataSelectDialog::OnCbnSelchangeCombo1)
END_MESSAGE_MAP()


// CDataSelectDialog message handlers

BOOL CDataSelectDialog::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here
	for(unsigned  i = 0;i<this->m_rgData.size();i++)
	{
		CString tmp;
		tmp.Format(" %u ",m_rgData[i]);
		this->m_cComboBox.InsertString(i,tmp.GetString());
	}
	this->m_cComboBox.SetCurSel(0);
	this->m_nSelData = this->m_rgData[m_cComboBox.GetCurSel()];

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void CDataSelectDialog::OnCbnSelchangeCombo1()
{
	// TODO: Add your control notification handler code here
	this->m_nSelData = this->m_rgData[m_cComboBox.GetCurSel()];
}
